package demo.common.exception;

import lombok.Data;

/**
 * 自定义异常处理
 */
@Data
public class SnowException extends RuntimeException {
    private Integer status;

    public SnowException() {
    }

    public SnowException(Integer status, String message) {
        super(message);
        this.status = status;
    }

    public SnowException(SnowExceptionEnum em) {
        super(em.getMessage());
        this.status = em.getStatus();
    }

    public SnowException(Integer status, String message, Throwable cause) {
        super(message, cause);
        this.status = status;
    }

    public SnowException(SnowExceptionEnum em, Throwable cause) {
        super(em.getMessage(), cause);
        this.status = em.getStatus();
    }
}
